﻿using Pay.Model.Dto;
using Pay.Model.Enums;
using Pay.Model.Interfaces;
using Pay.Model.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pay.Dal
{
   public  interface IUserDal
    {

        /// <summary>
        /// 根据merchantid获取商户
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<MerchantInfo> GetMerchantById(long id);
        /// <summary>
        /// 更新商户
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        Task<bool> UpdateMerchant(MerchantInfo user);

        Task<UserInfo> GetUserById(long userId);
        Task<UserInfo> GetUserByName(string UserName);

        Task<List<PermissionDto>> GetAllPermisson(long userId);

        Task<IPagedOutput<UserOutPut>> GetUserPage( long?  mId, UserType? type, string searchWord, DateTime? timeBegin = null, DateTime? timeEnd = null ,int offset=10,int rows=1);

        Task<long> Add(UserInfo user);

        Task<bool> Delete(UserInfo user);

        Task<bool> Update(UserInfo user);
        /// <summary>
        /// 新增商户
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        Task<long> AddMerchantUser(MerchantInfo info);
    }
}
